package com.springboot.java.design.simplefactory;

import com.springboot.java.design.model.Food;
import com.springboot.java.design.model.HuangMenChiKen;
import com.springboot.java.design.model.LanZhouNoodels;

/**
 * @Author: TongRui乀
 * @Date: 2019/3/5 13:27
 * @description： 简单工厂模式
 */
public class SimpleFactoryPattern {


    public static Food getFoodByType(String type){

        if("noodle".equalsIgnoreCase(type)){
            return new LanZhouNoodels();
        }else if("chiken".equalsIgnoreCase(type)){
            return new HuangMenChiKen();
        }

        return null;
    }

}
